UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V6CRBrO4Aj/ML2skuuGG8BdunFcIoZq9jjSfbwN94bc='
WHERE
key_id = 'fc782bd4db82eb9d1f8617efc5558330c5f27db28678bd06d0ed5d7f83cd6230'
AND (
token = 'V6CRBrO4Aj/ML2skuuGG8BdunFcIoZq9jjSfbwN94bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)