UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't3rBDvCRm8tU0fULMaNjcAOSKlCibtUkgcNSVBJY7DY='
WHERE
key_id = '00339dd84429e183739cb1a7dd637372a42762dafcf689d3cd968a634c4ced59'
AND (
token = 't3rBDvCRm8tU0fULMaNjcAOSKlCibtUkgcNSVBJY7DY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)