UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HcMoaLAXT/hJcESrBOOYBZp27+6Ork/S2Pr3EeulKLs='
WHERE
key_id = 'e2df8df279978d8a73490d8f6c308d0b4fa755e58121167095450e96340b23dc'
AND (
token = 'HcMoaLAXT/hJcESrBOOYBZp27+6Ork/S2Pr3EeulKLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)