UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RB6oIIxvkkosvUci47XtKAUn0lL37YCTMgDe+4HsGUs='
WHERE
key_id = 'f69355141e5c67134fa1363c8f84091f2614e8ac26a0e67aecf81e9353e69838'
AND (
token = 'RB6oIIxvkkosvUci47XtKAUn0lL37YCTMgDe+4HsGUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)