UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iOt13AMVLlEmGkFJKGxurlf4Feb2aQNb1XpbH25K+zo='
WHERE
key_id = '7374cd4ecb4a0291138a80ad4f6cbf5a4c41ef3f1ae4eecb0b0ba79884075956'
AND (
token = 'iOt13AMVLlEmGkFJKGxurlf4Feb2aQNb1XpbH25K+zo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)