UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lZ7LoJ6bHre4owTwHFCLD7RYHY6n5A60zjBuQhL7YAE='
WHERE
key_id = 'abfbdc3e9c2d0365b1e6d74ff6ea46a4fc57e73f6c486bda4d8547a8b8905b75'
AND (
token = 'lZ7LoJ6bHre4owTwHFCLD7RYHY6n5A60zjBuQhL7YAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)