UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ftHgHaeUILEnfd3L58DoOr7OTaFTW7SDS6wI95qSY4g='
WHERE
key_id = '982e05a3884a8b7b7ac7550cdd257d2fcf94bb583c8a1ec556b7b3097e93c58d'
AND (
token = 'ftHgHaeUILEnfd3L58DoOr7OTaFTW7SDS6wI95qSY4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)