UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ABZJxxRZNGCidrBV+kJ01yKTMD67ESK91CpYKpNNUFQ='
WHERE
key_id = '2fa3feae8c3d179f540bd067f148098e3ccf0fae600202a136841083a376c742'
AND (
token = 'ABZJxxRZNGCidrBV+kJ01yKTMD67ESK91CpYKpNNUFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)