UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm3qZP+mjGEHZ2SMpm93cEp27kdULyKIpefLi+a6YTe0='
WHERE
key_id = 'e025d751981e9669d9f3f4e905553bd01b5870303c74bad1db035660e9c64cd9'
AND (
token = 'm3qZP+mjGEHZ2SMpm93cEp27kdULyKIpefLi+a6YTe0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)