UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7zPDIetAfuFVg12hhIKdyEhmYzXWDHNTcY8/nCXZFM0='
WHERE
key_id = '25e0ecda02ce8f8dbf96281ea44f8648bc108d1f212759e3410add6c0dca2824'
AND (
token = '7zPDIetAfuFVg12hhIKdyEhmYzXWDHNTcY8/nCXZFM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)