UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qrj87pMKeTLB/me7Esgcv27g8gZWPz/kdnrsM3Si3mE='
WHERE
key_id = '4f132e8b6a2d792483d2d0200d6546fdda55a73ae568644ecf20aaf51de5709d'
AND (
token = 'qrj87pMKeTLB/me7Esgcv27g8gZWPz/kdnrsM3Si3mE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)