UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FqYvt8sQLPq4YoXCGhlP7TARaAyML9PpqLo/ki94+h4='
WHERE
key_id = '8de0b3525b57ce773463092c0681d67cebd73ec3ca366ed1d8c2246ff6389ec3'
AND (
token = 'FqYvt8sQLPq4YoXCGhlP7TARaAyML9PpqLo/ki94+h4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)