UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CMHIOHg9gHeXD2KtvgR9GJ4rR+3+gWxrlTUQz1zp5vs='
WHERE
key_id = '9061ad54348e18207beb1a7bf4bd2f53027ec3b1df062ab78286c05da0107a0f'
AND (
token = 'CMHIOHg9gHeXD2KtvgR9GJ4rR+3+gWxrlTUQz1zp5vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)