UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hZyukmzjBVucTNdLGKYBpxxUGAOg8CfFQlqQoGogJ4w='
WHERE
key_id = '7c4404e93dd17fe536a577c19651224a9b0e52b487e131bf2e2d63c5fec35f4e'
AND (
token = 'hZyukmzjBVucTNdLGKYBpxxUGAOg8CfFQlqQoGogJ4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)