UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+HugMioCrhfQN6ubryw6kt3Bsjeh4DUGRqZ1q3ih2ic='
WHERE
key_id = 'a3c38ecf19afb7c481a45ddfc91df6c7d70aae5fc1c212783269adf641b46f17'
AND (
token = '+HugMioCrhfQN6ubryw6kt3Bsjeh4DUGRqZ1q3ih2ic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)