UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xhe+3a2uiDaAp1E1UsJ0fQ0uJ6phcrgWs42LTsPoIq8='
WHERE
key_id = '4788baa6a30defc61d254cd43135f99c889da826bf4cc55d509963e7707f2731'
AND (
token = 'xhe+3a2uiDaAp1E1UsJ0fQ0uJ6phcrgWs42LTsPoIq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)