UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RHvNVSZ+6GY/rHxxbHy4RWXZLuR9cJ1fohq2HyNn8JU='
WHERE
key_id = 'e87d6651308ecd54aa39fb9b17dc3bb04d4fe8b6b68bfc6ad3f69dbf7ec2ffd6'
AND (
token = 'RHvNVSZ+6GY/rHxxbHy4RWXZLuR9cJ1fohq2HyNn8JU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)