UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qaBFxnKT6fSYBm2n9pCCe50aXZj9OLmnltI028gTFjk='
WHERE
key_id = '03612f0e1747944f5d56097d913c52141fba475771a1608cf38b71d792347559'
AND (
token = 'qaBFxnKT6fSYBm2n9pCCe50aXZj9OLmnltI028gTFjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)