UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rMsw83Dd8/tpNCEAr2yVs4N0CzBISYCk4HGH7WgGuj4='
WHERE
key_id = '37633eb222ddaeb178aafe32f1fe444b1ec99b28ab4facd9b6c6291a80e1a6da'
AND (
token = 'rMsw83Dd8/tpNCEAr2yVs4N0CzBISYCk4HGH7WgGuj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)