UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NNA7GyfDR0mYBxjL/EjmR5OcHOR/9ir2zYneM8JO0XA='
WHERE
key_id = '7303c0e3a0cdaf8cc61b6e39c3a237bdab1e85bd9b0f03ef5a7da497692e0707'
AND (
token = 'NNA7GyfDR0mYBxjL/EjmR5OcHOR/9ir2zYneM8JO0XA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)