UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kkIhO0EuYjHtdSvE+KDg75YruF7m9Fjs9fJ6XMtkFf4=' 
WHERE 
  key_id = '1905d5eabb39f7d0e5e1c23fddb3de5daa82b3919cb0877e5f95e3556ad9b042' 
  AND (
    token = 'kkIhO0EuYjHtdSvE+KDg75YruF7m9Fjs9fJ6XMtkFf4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027