UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WrSqloeGv6fSPxgil1/Bed9XwPV2VBbTM0e0aT5P8iY='
WHERE
key_id = '36b05608b1519c66ec340f86c7ffe858183d31950da762284018db59fa87f1cd'
AND (
token = 'WrSqloeGv6fSPxgil1/Bed9XwPV2VBbTM0e0aT5P8iY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)