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