UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1FoaUFr0gcyrbd+Zjj2YvlFAWwJRRXGFo7rywpQEPHE='
WHERE
key_id = '6dbb9be049129894bd360497d75d4f125d1fc3f67616d1073b67b23c575d0305'
AND (
token = '1FoaUFr0gcyrbd+Zjj2YvlFAWwJRRXGFo7rywpQEPHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)