UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vV1Mp8OJqY53+COAXvdEaL0zrtZ7N54F+zEjR5NCoYg='
WHERE
key_id = 'c6c931b619f9c42a280f1c0b47870a1fe257b1d6b055a3f5504b529e1624c6b6'
AND (
token = 'vV1Mp8OJqY53+COAXvdEaL0zrtZ7N54F+zEjR5NCoYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)