UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ezYl2Mq/KTR4uMrIj0BkedqXGV72qdEDZ2nRZOuK+Y=' 
WHERE 
  key_id = '266dfbd7a76c2d03a4ff7df0dc6d0b38cdab06a632a4b669a55c4c2f8efcf6a3' 
  AND (
    token = '0ezYl2Mq/KTR4uMrIj0BkedqXGV72qdEDZ2nRZOuK+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029