UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AGpr5SDCwt9NjpV1tW31X2MGhuFDY0M9J9s6WvUh/jM='
WHERE
key_id = 'f234490758fdebaf8e6b47d12cfb0a5b09ec781f1f76fcaf76d9d86745796a5c'
AND (
token = 'AGpr5SDCwt9NjpV1tW31X2MGhuFDY0M9J9s6WvUh/jM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)