UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qe52U4+U2UAo0azN0fCHwh2O+5lIGLcQsu8CuHCSyiU='
WHERE
key_id = 'a2cf8b2d7a9258d2d178882446dedfbf88f5864f26dc519a070c770b2c20c5b6'
AND (
token = 'qe52U4+U2UAo0azN0fCHwh2O+5lIGLcQsu8CuHCSyiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)