UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NpoV/aazkHdukIIwqKMfl0ihUApYP8vp1vSNc3t2SqE='
WHERE
key_id = '5c1aac52c73f55d433445511d37856a2230d6b1b553d4ce47175df0fcc7fa3e7'
AND (
token = 'NpoV/aazkHdukIIwqKMfl0ihUApYP8vp1vSNc3t2SqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)